// a ProductDB class that creates a product object
public class ProductDB //provides the data processing required by an application that displays the data for a product
{
	 // single static method  getProduct that returns a 
	 //Product object based on  the product code that is passed to it 
 public static Product getProduct (String productCode)  

 {
	 // create the Product Object
	 Product p= new Product();
	 // fill the Product object with data
	 
	// assign the product code that was passed to the getProduct method to the code filed of this object
		 p.setCode(productCode); 
		 if(productCode.equalsIgnoreCase("java"))
		 {
			 p.setDescription("Murachs java programming ");
			 p.setPrice(49.50);
		 }
		 else if(productCode.equalsIgnoreCase("jsps"))
		 {
			 p.setDescription("Murachs java servlets and jsp");
			 p.setPrice(55.50);
		 }
		 else if(productCode.equalsIgnoreCase("mcb2"))
		 {
			 p.setDescription("Murachs mainframe Cobol ");
			 p.setPrice(49.50);
		 }
		 else
		 {
			 p.setDescription("unknown");
		 }
		return p;
 }
}


//Note: the ProductDB class provides the database layer that creates a product object
//and ggets the data for it from a file or a database.